<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id='app'></div>
</body>
<script src="./js/vue.js"></script>
<script src="./js/vue-router.js"></script>
<script>
    // 1.vue引用插件
    Vue.use('VueRouter');
    // 2.创建router对象
    let router = new VueRouter({
        // 3.配置路由对象
        routes:[
            {path:'/login',component:{template:'<div>用户列表</div>'}}
        ]
    })
    // 4.指定路由改变局部的位置
    let App={
        template:`<div>
            <router-view></router-view>
        </div>`
    }

    new Vue({
        el:'#app',
        template:'<app/>',
        // 把路由对象放置在vue实例里
        router:router,
        components:{app:App}
    })





</script>
</html>